%% Import data from text file
% Script for importing data from the following text file:
%
%    filename: /biannualdata.csv
%
% Auto-generated by MATLAB on 22-Aug-2023 13:04:38

%% Set up the Import Options and import the data
opts = delimitedTextImportOptions("NumVariables", 21);

% Specify range and delimiter
opts.DataLines = [2, Inf];
opts.Delimiter = ",";

% Specify column names and types
opts.VariableNames = ["fac_id", "year", "PT1", "PT2", "PT3", "sic2", "name", "sic_final", "facid", "cycle", "DIFF1", "lnPT1", "lnDIFF1", "lnDIFF2", "a_hat", "period", "suma", "sumemi", "mean_wage", "mean_ppi", "half"];
opts.VariableTypes = ["categorical", "double", "double", "double", "double", "double", "categorical", "double", "categorical", "categorical", "double", "double", "double", "double", "double", "categorical", "double", "double", "double", "double", "double"];

% Specify file level properties
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";

% Specify variable properties
opts = setvaropts(opts, ["fac_id", "name", "facid", "cycle", "period"], "EmptyFieldRule", "auto");

% Import the data
biannualdata = readtable("biannualdata.csv", opts); %input the correct path to the first entry


%% Clear temporary variables
clear opts